home *** CD-ROM | disk | FTP | other *** search
- /*
- Commodore 64 Emulator v0.4 Earle F. Philhower III
- Copyright (C) 1993-4 (st916w9r@dunx1.ocs.drexel.edu)
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
- #include "Processor.h"
- #include "Resources.h"
-
- extern int programMode;
- extern Cursor commieCursor, diskCursor;
-
- void LoadTapeFS(FSSpec *spec)
- {
- short fNum;
- long len;
- byte data;
- word addr;
-
- FSpOpenDF(spec, fsRdPerm, &fNum);
- SetFPos(fNum, fsFromStart, 0x42);
- len=1; FSRead(fNum, &len, &data); addr=data;
- len=1; FSRead(fNum, &len, &data); addr+=((word)data)<<8;
-
- SetFPos(fNum, fsFromStart, 0x0400);
- len=1;
- while (len) FSRead(fNum, &len, &(RAM[addr++]));
- FSClose(fNum);
- }
-
-
- void LoadTape(void)
- {
- StandardFileReply reply;
-
- StandardGetFile(nil, (short)-1, nil, &reply);
- if (reply.sfGood)
- {
- SetCursor(&diskCursor);
- LoadTapeFS(&reply.sfFile);
- }
-
- if (programMode==kRunning) SetCursor(&commieCursor);
- else SetCursor(&qd.arrow);
- }
-